package com.orhon.smartcampus.modules.systemctl.mm;


import com.orhon.smartcampus.modules.base.mm.*;
import com.orhon.smartcampus.modules.systemctl.entity.OrgDepartmentUserRelation;
import com.orhon.smartcampus.modules.systemctl.entity.OrgDepartments;
import com.orhon.smartcampus.modules.systemctl.gqlModel.GQLDepartment;
import com.orhon.smartcampus.modules.systemctl.gqlModel.GQLDepartmentUsers;
import com.orhon.smartcampus.modules.user.mm.UserMapper;
import org.mapstruct.InheritConfiguration;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;


@Mapper(uses = {
        DictionaryMapper.class,
        LangMapper.class,
        UserMapper.class,
        SubjectMapper.class,
        GradeMapper.class,
        SchoolMapper.class
        
})
public interface DepartmentUsersRecordMapper {

    DepartmentUsersRecordMapper MAPPER = Mappers.getMapper(DepartmentUsersRecordMapper.class);

    @Mapping(source = "id" , target = "id")
    @Mapping(source = "isLeaders" , target = "is_leaders")
    @Mapping(source = "leaveAt" , target = "leave_at")
    @Mapping(source = "depDuty" , target = "dep_duty")
    @Mapping(target = "department" , ignore = true)
    @Mapping(target = "duty" , ignore = true)
    @Mapping(target = "user" , ignore = true)
    GQLDepartmentUsers toOrgDepartmentUsers(OrgDepartmentUserRelation entity);
    
    @InheritConfiguration(name = "toOrgDepartments")
    List<GQLDepartmentUsers> toOrgDepartmentUsersList(List<OrgDepartmentUserRelation> entities);

}
